package com.xuecheng.content.model.dto;

import com.xuecheng.base.exception.ValidatedGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * @description 增加课程教师信息请求参数
 * @author 勾新杰
 * @version 1.0
 * @date 2025/1/9 14:23
 */
@Data // 接收前端的参数用getter/setter 没有用构造器
@ApiModel(description = "添加课程教师信息")
public class SaveOrUpdateCourseTeacherDTO {

    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    @NotNull(message = "主键不能为空", groups = {ValidatedGroups.Update.class})
    private Long id;

    /**
     * 课程id
     */
    @ApiModelProperty("课程id")
    @NotNull(message = "课程id不能为空", groups = {ValidatedGroups.Insert.class})
    private Long courseId;

    /**
     * 课程教师名称
     */
    @ApiModelProperty("课程教师名称")
    @NotEmpty(message = "教师名称不能为空", groups = {ValidatedGroups.Insert.class})
    private String teacherName;

    /**
     * 教师职位
     */
    @ApiModelProperty("教师职位")
    @NotEmpty(message = "教师职位不能为空", groups = {ValidatedGroups.Insert.class})
    private String position;

    /**
     * 教师简介
     */
    @ApiModelProperty("教师简介")
    @NotEmpty(message = "教师简介不能为空", groups = {ValidatedGroups.Insert.class})
    @Size(min = 10, message = "教师简介不能少于10个字符", groups = {ValidatedGroups.Insert.class, ValidatedGroups.Update.class})
    private String introduction;

    /**
     * 教师照片
     */
    @ApiModelProperty("教师照片")
    @NotEmpty(message = "教师照片不能为空",groups = {ValidatedGroups.Insert.class})
    private String photograph;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDate;
}
